using UnityEngine;
using System.Collections;

public class Stars : MonoBehaviour {

	#region Fields
	public float Speed;
	#endregion
	
	#region Properties
	private Transform mTransform;
	#endregion
	
	#region Functions
	// Use this for initialization
	void Start () 
	{
		// Keep a reference to the transfrom
		mTransform = transform;
		
		
	}
	
	// Update is called once per frame
	void Update () 
	{
		// Get the amount of movement
		float amntMovement = Speed * Time.deltaTime;
		
		// Apply the movement to the object. It'll be moving downwards the Y axis
		mTransform.Translate(Vector3.down * amntMovement, Space.World);
		
		// Check if the projectile is leaving the screen
		if(mTransform.position.y < -11.9f)
		{
			// Refresh the position
			mTransform.position = new Vector3(mTransform.position.x, 14f, mTransform.position.z);
		}
	}
	
	
	#endregion
}
